package org.dfl.plugin.views.actions;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;

/**
 * event used to manually fire selection changes
 * @author Piotr Wlodarczyk
 *
 */
public class DflSelectionChangedEvent extends SelectionChangedEvent{
	/**
	 * 
	 */
	private static final long serialVersionUID = -4414648837206562451L;

	public DflSelectionChangedEvent(final Object selected) {
		super( new ISelectionProvider(){

			public void addSelectionChangedListener(
					ISelectionChangedListener listener) {
			}

			public ISelection getSelection() {
				return  new StructuredSelection(selected);
			}

			public void removeSelectionChangedListener(
					ISelectionChangedListener listener) {
			}

			public void setSelection(ISelection selection) {
			}}, new StructuredSelection(selected));
	}

}
